package com.bml.es.controller;

import com.bml.es.service.ProductService;
import com.bml.es.vo.CommonResult;
import com.bml.es.vo.ESRequestParam;
import com.bml.es.vo.ESResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/es")
public class SearchController {


    @Autowired
    public ProductService productService;

    @ResponseBody
    @RequestMapping("/search")
    public CommonResult<ESResponseResult> search(ESRequestParam param) {
        ESResponseResult search = productService.search(param);
        return CommonResult.success(search);
    }


}
